<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="../template.xhtml">
    <ui:param name="title" value="Listing all users"/>
    <ui:define name="content">
        <h1>List of the users</h1>
        <h:form>
        <h:dataTable value="#{userController.userList}" var="user">
            <h:column>
                <f:facet name="header">
                    <h:outputText value="email"/>
                </f:facet>
                <h:outputText value="#{user.email}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="password"/>
                </f:facet>
                <h:outputText value="#{user.password}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="name"/>
                </f:facet>
                <h:outputText value="#{user.name}"/>
            </h:column>
            <h:column>
                <f:facet name="header">
                    <h:outputText value="remove"/>
                </f:facet>
                <h:commandLink value="remove" action="#{userController.doDelete}">
                    <f:setPropertyActionListener target="#{userController.user}" value="#{user}" />
                </h:commandLink>
            </h:column>
        </h:dataTable>
        </h:form>
        <h:form>
            <h:commandLink action="#{userController.showCreate}">Create a new user</h:commandLink>
        </h:form>
    </ui:define>
</ui:composition>